<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
  <meta charset="UTF-8">
  <title>Admin</title>
</head>
<body>
<div class="container">

  <ul class="layui-nav right" lay-filter="">
    <li class="layui-nav-item">
      <a>欢迎你，[[${session.SPRING_SECURITY_CONTEXT.authentication.principal.adminName}]]</a>
      <a th:href="@{/logout}">退出</a>
    </li>

  </ul>

</div>

<div class="left-nav">
  <div id="side-nav">
    <ul id="nav">

      <li>
        <a >
          <cite>用户管理</cite>
        </a>
        <ul class="sub-menu">
          <li>
            <a th:href="@{/admin_teacher_list}">
              <cite>老师管理</cite>
            </a>
          </li>
          <li>
            <a th:href="@{/admin_stu_list}">
              <cite>学生管理</cite>
            </a>
          </li>
          <li sec:authorize="hasRole('ROLE_super')">
            <a th:href="@{/super_admin_list}">
              <cite>管理员管理</cite>
            </a>
          </li>
        </ul>
      </li>
      <a >
        <cite>课程管理</cite>
      </a>
      <ul class="sub-menu">
        <li>
          <a th:href="@{/course_list}">
            <cite>课程管理</cite>
          </a>
        </li>
        <li>
          <a th:href="@{/class_list}">
            <cite>班级管理</cite>
          </a>
        </li>
        <li>
          <a th:href="@{/score_list}">
            <cite>成绩审阅</cite>
          </a>
        </li>
      </ul>
      </li>
    </ul>
  </div>
</div>

<div class="page-content">
  <div class="layui-tab tab" lay-filter="xbs_tab" lay-allowclose="false">
    <ul>
      <li></li>
    </ul>
    <div class="layui-tab-content">
      <a th:href="@{/super_admin_add}">添加管理员</a>

      <table class="user-table">
        <thead>
        <tr>
          <th>账号</th>
          <th>状态</th>
        </tr>
        </thead>
        <tbody th:each="admin:${session.adminList}">
        <tr>

          <td th:text="${admin.adminName}">小明</td>
          <td th:text="${admin.adminStatus}==1?'正常':'禁用'">123456</td>

          <td class="admin-manage">
            <a  th:href="@{/admin_password_jump/{id}(id = ${admin.id})}">
              修改密码
            </a>
          </td>
          <td>
            <a  th:href="@{/admin_status/{id}(id = ${admin.id})}"  th:text="${admin.adminStatus}==0?'启用':'禁用'">

            </a>
          </td>


        </tr>

        </tbody>
      </table>


    </div>
  </div>
</div>
</div>
</body>
</html>